<template>
    <div v-html="renderedFormula"></div>
</template>

<script>
import katex from 'katex';
import 'katex/dist/katex.min.css';

export default {
    props: {
        formula: String
    },
    computed: {
        renderedFormula() {
            return katex.renderToString(this.formula, { throwOnError: false });
        }
    }
};
</script>